Component({
    properties: {
        show: Boolean
    },
    data: {
        diceStyles: [],
        selectedStyle: {}
    },
    lifetimes: {
        attached: function() {
            var e = getApp().globalData.diceStyles;
            this.setData({
                diceStyles: e,
                selectedStyle: e[0]
            });
        },
        detached: function() {}
    },
    methods: {
        changeSwiper: function(e) {
            var t = e.detail.current, a = this.data.diceStyles[t];
            this.setData({
                selectedStyle: a
            });
        },
        changeStyle: function(e) {
            var t = e.currentTarget.dataset.index, a = this.data.diceStyles[t];
            this.setData({
                selectedStyle: a
            });
        },
        numberChecked: function(e) {
            var t = getApp().globalData.diceStyles, a = t[0], s = e.currentTarget.id;
            a.nums = s, getApp().globalData.diceStyles = t, this.setData({
                diceStyles: t
            });
        },
        close: function() {
            for (var e = getApp().globalData.diceStyles, t = 0; t < e.length; t++) {
                var a = e[t];
                a.tag === this.data.selectedStyle.tag ? a.selected = "yes" : a.selected = "";
            }
            getApp().globalData.diceStyles = e, wx.setStorageSync("diceStyles", e), console.log("close"), 
            this.triggerEvent("changeSetting", {}, {});
        }
    }
});